Optimal. Leaf size=189 \[ \frac {3 i d^3 x}{8 a f^3}-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \tan (e+f x))}-\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 189, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3804, 3560, 8}
\begin {gather*} -\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \tan (e+f x))}+\frac {3 i d^3 x}{8 a f^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3560
Rule 3804
Rubi steps
\begin {align*} \int \frac {(c+d x)^3}{a+i a \tan (e+f x)} \, dx &=\frac {(c+d x)^4}{8 a d}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}-\frac {(3 i d) \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx}{2 f}\\ &=-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}-\frac {\left (3 d^2\right ) \int \frac {c+d x}{a+i a \tan (e+f x)} \, dx}{2 f^2}\\ &=-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}+\frac {\left (3 i d^3\right ) \int \frac {1}{a+i a \tan (e+f x)} \, dx}{4 f^3}\\ &=-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \tan (e+f x))}-\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}+\frac {\left (3 i d^3\right ) \int 1 \, dx}{8 a f^3}\\ &=\frac {3 i d^3 x}{8 a f^3}-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \tan (e+f x))}-\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.46, size = 278, normalized size = 1.47 \begin {gather*} \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (\left (4 i c^3 f^3+6 c^2 d f^2 (1+2 i f x)+6 c d^2 f \left (-i+2 f x+2 i f^2 x^2\right )+d^3 \left (-3-6 i f x+6 f^2 x^2+4 i f^3 x^3\right )\right ) \cos (2 f x) (\cos (e)-i \sin (e))+2 f^4 x \left (4 c^3+6 c^2 d x+4 c d^2 x^2+d^3 x^3\right ) (\cos (e)+i \sin (e))+\left (4 c^3 f^3+6 c^2 d f^2 (-i+2 f x)+6 c d^2 f \left (-1-2 i f x+2 f^2 x^2\right )+d^3 \left (3 i-6 f x-6 i f^2 x^2+4 f^3 x^3\right )\right ) (\cos (e)-i \sin (e)) \sin (2 f x)\right )}{16 f^4 (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 1060 vs. \(2 (165 ) = 330\).
time = 0.47, size = 1061, normalized size = 5.61
method | result | size |
risch | \(\frac {d^{3} x^{4}}{8 a}+\frac {d^{2} c \,x^{3}}{2 a}+\frac {3 d \,c^{2} x^{2}}{4 a}+\frac {c^{3} x}{2 a}+\frac {c^{4}}{8 d a}+\frac {i \left (4 d^{3} x^{3} f^{3}+12 c \,d^{2} f^{3} x^{2}-6 i d^{3} f^{2} x^{2}+12 c^{2} d \,f^{3} x -12 i c \,d^{2} f^{2} x +4 c^{3} f^{3}-6 i c^{2} d \,f^{2}-6 d^{3} f x -6 c \,d^{2} f +3 i d^{3}\right ) {\mathrm e}^{-2 i \left (f x +e \right )}}{16 a \,f^{4}}\) | \(170\) |
default | \(\text {Expression too large to display}\) | \(1061\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 166, normalized size = 0.88 \begin {gather*} \frac {{\left (4 i \, d^{3} f^{3} x^{3} + 4 i \, c^{3} f^{3} + 6 \, c^{2} d f^{2} - 6 i \, c d^{2} f - 3 \, d^{3} - 6 \, {\left (-2 i \, c d^{2} f^{3} - d^{3} f^{2}\right )} x^{2} - 6 \, {\left (-2 i \, c^{2} d f^{3} - 2 \, c d^{2} f^{2} + i \, d^{3} f\right )} x + 2 \, {\left (d^{3} f^{4} x^{4} + 4 \, c d^{2} f^{4} x^{3} + 6 \, c^{2} d f^{4} x^{2} + 4 \, c^{3} f^{4} x\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{16 \, a f^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.20, size = 258, normalized size = 1.37 \begin {gather*} \begin {cases} \frac {\left (4 i c^{3} f^{3} + 12 i c^{2} d f^{3} x + 6 c^{2} d f^{2} + 12 i c d^{2} f^{3} x^{2} + 12 c d^{2} f^{2} x - 6 i c d^{2} f + 4 i d^{3} f^{3} x^{3} + 6 d^{3} f^{2} x^{2} - 6 i d^{3} f x - 3 d^{3}\right ) e^{- 2 i e} e^{- 2 i f x}}{16 a f^{4}} & \text {for}\: a f^{4} e^{2 i e} \neq 0 \\\frac {c^{3} x e^{- 2 i e}}{2 a} + \frac {3 c^{2} d x^{2} e^{- 2 i e}}{4 a} + \frac {c d^{2} x^{3} e^{- 2 i e}}{2 a} + \frac {d^{3} x^{4} e^{- 2 i e}}{8 a} & \text {otherwise} \end {cases} + \frac {c^{3} x}{2 a} + \frac {3 c^{2} d x^{2}}{4 a} + \frac {c d^{2} x^{3}}{2 a} + \frac {d^{3} x^{4}}{8 a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 193, normalized size = 1.02 \begin {gather*} \frac {{\left (2 \, d^{3} f^{4} x^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + 8 \, c d^{2} f^{4} x^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 12 \, c^{2} d f^{4} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, d^{3} f^{3} x^{3} + 8 \, c^{3} f^{4} x e^{\left (2 i \, f x + 2 i \, e\right )} + 12 i \, c d^{2} f^{3} x^{2} + 12 i \, c^{2} d f^{3} x + 6 \, d^{3} f^{2} x^{2} + 4 i \, c^{3} f^{3} + 12 \, c d^{2} f^{2} x + 6 \, c^{2} d f^{2} - 6 i \, d^{3} f x - 6 i \, c d^{2} f - 3 \, d^{3}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{16 \, a f^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.56, size = 423, normalized size = 2.24 \begin {gather*} \frac {8\,c^3\,f^4\,x-3\,d^3\,\cos \left (2\,e+2\,f\,x\right )+4\,c^3\,f^3\,\sin \left (2\,e+2\,f\,x\right )+2\,d^3\,f^4\,x^4+6\,c^2\,d\,f^2\,\cos \left (2\,e+2\,f\,x\right )+12\,c^2\,d\,f^4\,x^2+8\,c\,d^2\,f^4\,x^3+6\,d^3\,f^2\,x^2\,\cos \left (2\,e+2\,f\,x\right )+4\,d^3\,f^3\,x^3\,\sin \left (2\,e+2\,f\,x\right )-6\,c\,d^2\,f\,\sin \left (2\,e+2\,f\,x\right )-6\,d^3\,f\,x\,\sin \left (2\,e+2\,f\,x\right )+12\,c\,d^2\,f^2\,x\,\cos \left (2\,e+2\,f\,x\right )+12\,c^2\,d\,f^3\,x\,\sin \left (2\,e+2\,f\,x\right )+12\,c\,d^2\,f^3\,x^2\,\sin \left (2\,e+2\,f\,x\right )+d^3\,\sin \left (2\,e+2\,f\,x\right )\,3{}\mathrm {i}+c^3\,f^3\,\cos \left (2\,e+2\,f\,x\right )\,4{}\mathrm {i}-c^2\,d\,f^2\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+d^3\,f^3\,x^3\,\cos \left (2\,e+2\,f\,x\right )\,4{}\mathrm {i}-d^3\,f^2\,x^2\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-c\,d^2\,f\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-d^3\,f\,x\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+c^2\,d\,f^3\,x\,\cos \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}-c\,d^2\,f^2\,x\,\sin \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}+c\,d^2\,f^3\,x^2\,\cos \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}}{16\,a\,f^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________